#include <stdint.h>
#include <stdlib.h>
#include "config.h"
#include "apitrans.h"
#include "result.h"
#include "devapi.h"

#if defined(_SUPPORT_SEC_STATE)
int api_get_security_status(unsigned char *cmd, int len)
{

	uint16_t ret = DEAL_SUCCESS;;
	uint8_t offset = 0;
	if(offset != len){
		ret = ERROR_PARAM;
		memcpy(cmd, &ret, 2);
		return -1;
	}

	memcpy((char*)cmd,&ret,2);
	offset += 2;
    sprintf( (char*)cmd + offset, "%08X", (unsigned int)security_status( ));
	offset += 8;
	return offset;
}
#else
int api_get_security_status(unsigned char *cmd, int len)
{
	return 0;
}

#endif

static func_t security_fun[] = {
	NULL, api_get_security_status
};
#define MEKYMGT_NUM 1
int cmd_security(uint8_t cmd,uint8_t *buf, int len)
{
	if(cmd < 0x01 || cmd > FUN_SIZE(security_fun))
		return -5;
	return security_fun[(int)cmd]( (uint8_t*)buf, len);
}


